import { ElMessage, ElMessageBox, ElNotification } from 'element-plus';

export function useMessage() {
  const createMessage = (options) => {
    ElMessage(options);
  };

  const notification = (options) => {
    ElNotification(options);
  };

  const createConfirm = async (message, title = '提示') => {
    return await ElMessageBox.confirm(message, title, {
      confirmButtonText: '确定',
      cancelButtonText: '取消',
      type: 'warning',
    });
  };

  return {
    createMessage,
    notification,
    createConfirm,
  };
}
